<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>表单提交2</title>
		
	</head>
	<body>
		<div id="app">
		
		<!-- 属性说明：
			1.  .number 将用户输入变为数值类型
			2.  .trim   去掉开头和结尾的空格
			3.  .lazy   懒加载,当鼠标离焦时生效
		 -->
		 <input name="age" v-model.number="age" />
		 <button @click="expand">增加10</button> <br />
		
		 <input name="name" v-model.trim="name" />
		 获取name属性的长度{{name.length}} <br />
		 
		 <input name="username" v-model.lazy="username" />
		 观察响应现象{{username}}
		</div>
		
		<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
		
		<script>
			const app = new Vue({
				el: "#app",
				data: {
					age: '',
					name: '',
					username: ''
				},
			
				methods: {
					expand(){
						this.age = 10 + this.age
					}
				}
			})
		</script>
		
	</body>
</html>

